/* 现代化后台管理界面样式 */
:root {
  /* 主色调 - 更现代的颜色 */
  --primary-color: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;
  
  /* 辅助色 - 更鲜明的色彩 */
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --danger-color: #ef4444;
  --info-color: #3b82f6;
  
  /* 中性色 */
  --bg-color: #f9fafb;
  --card-bg: #ffffff;
  --text-primary: #1f2937;
  --text-secondary: #4b5563;
  --text-muted: #9ca3af;
  --border-color: #e5e7eb;
  
  /* 阴影 - 更精细的阴影效果 */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
  
  /* 圆角 */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  
  /* 动画 */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.35s ease;
  
  /* 间距 */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-xxl: 3rem;
}

/* 基础样式 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* 添加背景图片 */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-color);
  background-image: url('https://cdn.pixabay.com/photo/2018/02/23/04/38/laptop-3174729_1280.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
  position: relative;
  min-height: 100vh;
  padding: 0;
  margin: 0;
}

/* 添加背景遮罩 */
body::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(5px);
  z-index: -1;
}

/* 布局容器 */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--spacing-lg);
  position: relative;
  z-index: 1;
}

/* 顶部导航栏 - 玻璃态效果 */
.top-nav {
  background-color: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-md);
  padding: var(--spacing-md) var(--spacing-lg);
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.top-nav h1 {
  font-size: 1.5rem;
  margin: 0;
  color: var(--primary-color);
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.logout-link {
  display: inline-block;
}

.logout-link a {
  color: var(--text-secondary);
  text-decoration: none;
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  font-weight: 500;
  font-size: 0.9rem;
  background-color: rgba(255, 255, 255, 0.5);
}

.logout-link a:hover {
  background-color: var(--primary-light);
  color: var(--primary-color);
  box-shadow: var(--shadow-sm);
}

/* 页面标题 */
.page-title, h1 {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--primary-color);
  margin: var(--spacing-xl) 0;
  text-align: center;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  letter-spacing: -0.5px;
}

/* 卡片部分 - 玻璃态效果 */
.section {
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--spacing-xl);
  margin-bottom: var(--spacing-xl);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.section:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  background-color: rgba(255, 255, 255, 0.9);
}

.section-title {
  color: var(--primary-color);
  font-size: 1.35rem;
  font-weight: 600;
  margin-bottom: var(--spacing-lg);
  padding-bottom: var(--spacing-sm);
  border-bottom: 2px solid var(--primary-light);
  position: relative;
  letter-spacing: -0.3px;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 60px;
  height: 2px;
  background-color: var(--primary-color);
  border-radius: 2px;
}

/* 按钮样式 - 更现代的按钮 */
button {
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

button::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, 0.5);
  opacity: 0;
  border-radius: 100%;
  transform: scale(1, 1) translate(-50%);
  transform-origin: 50% 50%;
}

button:hover {
  background-color: var(--primary-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

button:active::after {
  animation: ripple 0.6s ease-out;
}

@keyframes ripple {
  0% {
    transform: scale(0, 0);
    opacity: 0.5;
  }
  100% {
    transform: scale(20, 20);
    opacity: 0;
  }
}

button[type="submit"] {
  background-color: var(--success-color);
  background-image: linear-gradient(135deg, var(--success-color), #059669);
}

button[type="submit"]:hover {
  background-image: linear-gradient(135deg, #059669, var(--success-color));
}

/* 添加更多动画效果 */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
  from { transform: translateX(-30px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* 应用动画到元素 */
.section {
  animation: fadeIn 0.6s ease-out;
}

.success-message, .error {
  animation: slideIn 0.5s ease-out;
}

h1 {
  animation: pulse 2s infinite;
}

/* 其余样式保持不变 */
label {
  display: block;
  margin-bottom: var(--spacing-xs);
  font-weight: 500;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

input[type="text"],
input[type="number"],
input[type="password"],
textarea,
select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: var(--card-bg);
  color: var(--text-primary);
  font-size: 1rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  margin-bottom: var(--spacing-md);
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
}

.form-group {
  margin-bottom: var(--spacing-md);
}

/* 复选框样式 */
.checkbox-group {
  margin: var(--spacing-md) 0;
  display: flex;
  align-items: center;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  cursor: pointer;
  margin-bottom: 0;
  font-weight: 400;
  color: var(--text-primary);
  font-size: 1rem;
}

input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  margin-right: var(--spacing-sm);
  position: relative;
  cursor: pointer;
  transition: all var(--transition-fast);
}

input[type="checkbox"]:checked {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* 按钮样式 */
button {
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

button:hover {
  background-color: var(--primary-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

button:active {
  transform: translateY(0);
}

button + button {
  margin-left: var(--spacing-md);
}

button[type="submit"] {
  background-color: var(--success-color);
}

button[type="submit"]:hover {
  background-color: #27ae60;
}

button.danger {
  background-color: var(--danger-color);
}

button.danger:hover {
  background-color: #c0392b;
}

button.secondary {
  background-color: var(--text-muted);
}

button.secondary:hover {
  background-color: var(--text-secondary);
}

/* 域名管理 */
.domain-entry {
  display: flex;
  align-items: center;
  margin-bottom: var(--spacing-sm);
  animation: fadeIn var(--transition-normal);
}

.domain-entry input {
  flex: 1;
  margin-bottom: 0;
  margin-right: var(--spacing-sm);
}

.domain-entry .remove-domain {
  padding: 0.5rem 1rem;
  background-color: var(--danger-color);
}

#addDomain {
  margin-top: var(--spacing-sm);
  background-color: var(--info-color);
}

#addDomain:hover {
  background-color: #2980b9;
}

/* 消息提示 */
.success-message {
  background-color: rgba(46, 204, 113, 0.1);
  border-left: 4px solid var(--success-color);
  color: #27ae60;
  padding: var(--spacing-md);
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-lg);
  animation: slideIn var(--transition-normal);
}

.error {
  background-color: rgba(231, 76, 60, 0.1);
  border-left: 4px solid var(--danger-color);
  color: #c0392b;
  padding: var(--spacing-md);
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-lg);
  animation: slideIn var(--transition-normal);
}

/* 配置预览 */
#preview {
  margin-top: var(--spacing-xl);
  background-color: #2d3748;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

#preview h3 {
  background-color: #1a202c;
  color: white;
  padding: var(--spacing-md);
  margin: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#preview h3 button {
  font-size: 0.8rem;
  padding: 0.4rem 0.8rem;
  background-color: var(--info-color);
}

#configPreview {
  padding: var(--spacing-md);
  margin: 0;
  color: #e2e8f0;
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: 0.9rem;
  line-height: 1.5;
  overflow-x: auto;
  max-height: 400px;
  overflow-y: auto;
}

/* 文本区域 */
textarea {
  min-height: 150px;
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: 0.9rem;
  line-height: 1.5;
  resize: vertical;
}

/* 动画 */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
  from { transform: translateX(-20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* 响应式设计 */
@media (max-width: 992px) {
  .container {
    padding: var(--spacing-md);
  }
  
  .section {
    padding: var(--spacing-lg);
  }
}

@media (max-width: 768px) {
  .page-title {
    font-size: 1.75rem;
    margin: var(--spacing-lg) 0;
  }
  
  h1 {
    font-size: 1.75rem;
    margin: var(--spacing-lg) 0;
  }
  
  .section {
    padding: var(--spacing-md);
  }
  
  button + button {
    margin-left: var(--spacing-sm);
  }
}

@media (max-width: 576px) {
  .top-nav {
    flex-direction: column;
    text-align: center;
    padding: var(--spacing-sm);
  }
  
  .logout-link {
    margin-top: var(--spacing-sm);
  }
  
  button, button + button {
    width: 100%;
    margin-left: 0;
    margin-top: var(--spacing-sm);
  }
  
  /* 修改这部分代码以修复黑名单按钮对齐问题 */
  .section form div {
    display: flex;
    flex-direction: column;
    width: 100%;
  }
  
  /* 确保所有按钮样式一致 */
  .section form div button {
    margin-left: 0 !important;
    margin-top: var(--spacing-sm);
    width: 100% !important;
  }
  
  /* 移除所有内联样式中的margin-left */
  [style*="margin-left"] {
    margin-left: 0 !important;
  }
  
  .domain-entry {
    flex-direction: column;
    align-items: stretch;
  }
  
  .domain-entry input {
    margin-right: 0;
    margin-bottom: var(--spacing-sm);
  }
}
